<?php
/*
 * Created by PhpStorm.
 * Date: 16/9/27
 * Time: 下午3:20
 * User: liubin
 */

namespace api\Model;

use Think\Model;

class CaseEntityModel extends Model
{
    function __construct() {
        $this->model = M('CaseEntity');
    }

    public function getCaselist($type,$condition,$page=1,$perpage=10,$field = array('*')) {
        $data = $this->model->where("case_type='".$type."'and dataval='".$condition."'")->field($field)->page($page,$perpage)->select();
        foreach ($data as $key=>$value){
            $data[$key]['allnum'] = $this->model->where("case_type='".$type."'and dataval='".$condition."'")->count();
        }
        $data = $data ? $data : array();
        return $data;
    }


}